// This file was decompiled using SASCM.ini published on 2020-11-11
{$CLEO .CS}

03A4: script_name "BARRETTM82RDBUY" 

:BARRETTM82RDBUY_19
0001: wait 0 ms 
00D6: if and
0256:   player 0 defined 
0ADC:   test_cheat "BARRETTM82RDBUY" 
004D: jump_if_false @BARRETTM82RDBUY_19 
00D6: if 
010A:   player $PLAYER_CHAR money > 16999 
004D: jump_if_false @BARRETTM82RDBUY_309 
0001: wait 0 ms 
0208: 3@ = random_float_in_ranges -7.0 10.0 
0208: 4@ = random_float_in_ranges -10.0 7.0 
04C4: store_coords_to $X $Y $Z from_actor $PLAYER_ACTOR with_offset 3@ 4@ -1.0 
0107: $OBJECAT = create_object 1224 at $X $Y $Z 
0382: set_object $OBJECAT collision_detection 1 
0400: store_coords_to $X2 $Y2 $Z2 from_object $OBJECAT with_offset 0.0 0.0 0.0 
0213: $BARRETTM82RDSN = create_pickup 12439 type 3 at $X2 $Y2 $Z2 
03DC: $BARRETTM82RDSNM = create_marker_above_pickup $BARRETTM82RDSN 

:BARRETTM82RDBUY_215
0001: wait 0 ms 
00D6: if 
0214:   pickup $BARRETTM82RDSN picked_up 
004D: jump_if_false @BARRETTM82RDBUY_215 
0002: jump @BARRETTM82RDBUY_242 

:BARRETTM82RDBUY_242
0247: load_model 12439 
038B: load_requested_models 
0001: wait 0 ms 
00D6: if 
0248:   model 12439 available 
004D: jump_if_false @BARRETTM82RDBUY_242 
01B2: give_actor $PLAYER_ACTOR weapon 109 ammo 10 // Load the weapon model before using this 
0002: jump @BARRETTM82RDBUY_285 

:BARRETTM82RDBUY_285
0001: wait 0 ms 
0109: player $PLAYER_CHAR money += -17000 
01C4: remove_references_to_object $OBJECAT // This object will now disappear when the player looks away 
0002: jump @BARRETTM82RDBUY_19 

:BARRETTM82RDBUY_309
0001: wait 0 ms 
0512: show_permanent_text_box 'NOMONEY' 
0001: wait 2000 ms 
03E6: remove_text_box 
0002: jump @BARRETTM82RDBUY_19 
